home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Camelot / Camelot 064 (1990-02)(Swedish User Group of Amiga)(SE)(PD)[WB].zip / Camelot 064 (1990-02)(Swedish User Group of Amiga)(SE)(PD)[WB].adf / cclib / include / ctype.h < prev    next >
C/C++ Source or Header  |  1990-02-14  |  768b  |  27 lines

  1. #ifndef CTYPE_H
  2. #define CTYPE_H 1
  3.  
  4. /* this baby lives in CClib.library so don't mess with it */
  5. extern char *type;
  6.  
  7. /* C type macros a-la K&R (For the ASCII character set) */
  8. #define isalpha(X)  (type[(X)+1] & 0x03)
  9. #define isupper(X)  (type[(X)+1] & 0x01)
  10. #define islower(X)  (type[(X)+1] & 0x02)
  11. #define isdigit(X)  (type[(X)+1] & 0x04)
  12. #define isxdigit(X) (type[(X)+1] & 0x08)
  13. #define isalnum(X)  (type[(X)+1] & 0x07)
  14. #define isspace(X)  (type[(X)+1] & 0x10)
  15. #define ispunct(X)  (type[(X)+1] & 0x40)
  16. #define iscntrl(X)  (type[(X)+1] & 0x20)
  17. #define isprint(X)  (type[(X)+1] & 0xc7)
  18. #define isgraph(X)  (type[(X)+1] & 0x47)
  19. #define isascii(X)  (!((X) & 0x80))
  20.  
  21. #define toascii(X)  ((X) & 127)
  22. #define tolower(X) ((X) | 0x20)
  23. #define toupper(X) ((X) & 0x5f)
  24.  
  25. #endif
  26.  
  27.